#!/bin/bash
file_name=functions.sh
funcs=`which $file_name`
if [ "$funcs" != "" ] ;then
  echo "funcs=$funcs"
  . $funcs
else
  funcs=`dirname $0`/$file_name
  echo "$PWD"
  echo "funcs=$funcs"
  if [ "$funcs" != "" ] ;then
    . $funcs
  else
    exit
  fi
fi
#脚步入口：解析参数
while test $# != 0
do
    case $1 in
	-t)
	    shift
	    type=$1
	    ;;
	-m)
	    shift
	    mode=$1
	    ;;
	--work-copy)
	    shift
	    work_copy=$1
	    ;;
	-d)
	    shift
	    product_name=$1
	    ;;

        *)
	    name=$1
	    ;;
       esac
       shift
done
if [ "$mode" == "cmd" ]; then
    echo "$mode"
elif [ "$mode" == "compiler" ]; then 
  sh_fetion_compile_results  $work_copy  $product_name
else
  echo "$mode"
fi
